package com.atcc.demo.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.atcc.demo.dao.Person;
import com.atcc.demo.dao.StudentInfo;
import com.atcc.demo.mapper.PersonMapper;


@Service
public class PersonServiceImp implements PersonService{
	
	@SuppressWarnings("unused")
	@Autowired
	private PersonMapper personmapper;
	
	@Override
	public int addPerson(Person person) {
		return personmapper.add(person);
	}

	@Override
	public int deleteByPersonId(String id) {
		int result = personmapper.deleteByPrimaryKey(id);
		return result;
	}

	@Override
	public int updateByPersonId(Person record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Person selectByPersonId(int id) {
		
		return personmapper.selectById(id);
	}

	@Override
	public List<Person> selectAllPerson() {
		return personmapper.selectAllPerson();
	}

	@Override
	public List<StudentInfo> selectByName(String name) {
		return personmapper.selectByName(name);
	}
	

}
